package com.zhisheng.utils;

/*
    全哥
*/

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyHuToolUtils {

    /**
     * 数据中心ID
     */
    private final long datacenterId = 1L;

    /**
     * 机器ID
     */
    private final long workerId = 4L;

    @Bean
    public Snowflake snowflake() {
        return IdUtil.createSnowflake(workerId, datacenterId);
    }

}
